﻿<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>莫宁会员账号激活-莫宁互联网信息服务股份有限公司</title>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1">
    <link rel="shortcut icon" href="/favicon.ico">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">

    <link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
    <link rel="stylesheet" href="http://g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">
	<style>
		.btn-full{
		    display:block;
			width:100%;
			margin:0 auto;
		}
		.xx{
			color:red;
		}
	</style>
  </head>
  <body>
    <header class="bar bar-nav">
  <h1 class='title'>莫宁会员账号激活</h1>
</header>
<div class="content">
  <div class="list-block">
  <form>
    <ul>
      <!-- Text inputs -->
	  <li>
        <div class="item-content">
          <div class="item-media"><i class="icon icon-form-password"></i></div>
          <div class="item-inner">
            <div class="item-title label">分配的卡号<span class="xx">*</span></div>
            <div class="item-input">
              <input type="text" name="account" id="account" value="{$account}" placeholder="请输入以19开头的11位卡号" class="">
            </div>
          </div>
        </div>
      </li>
	  <li>
        <div class="item-content">
          <div class="item-media"><i class="icon icon-form-password"></i></div>
          <div class="item-inner">
            <div class="item-title label">初始密码<span class="xx">*</span></div>
            <div class="item-input">
              <input type="text" name="pwd" id="pwd" value="{$pwd}" placeholder="请输入6位初始密码,字母区分大小写" class="">
            </div>
          </div>
        </div>
      </li>
	  <li>
        <div class="item-content">
          <div class="item-media"><i class="icon icon-form-name"></i></div>
          <div class="item-inner">
            <div class="item-title label">姓名<span class="xx">*</span></div>
            <div class="item-input">
              <input type="text" name="true_name" id="true_name" placeholder="您的真实姓名">
            </div>
          </div>
        </div>
      </li>
	  <li>
        <div class="item-content">
          <div class="item-media"><i class="icon icon-form-password"></i></div>
          <div class="item-inner">
            <div class="item-title label">您的手机号码<span class="xx">*</span></div>
            <div class="item-input">
              <input type="text" name="mobile" id='mobile' placeholder="请输入您的手机号码" class="">
            </div>
          </div>
        </div>
      </li>
      <li>
        <div class="item-content">
          <div class="item-media"><i class="icon icon-form-password"></i></div>
          <div class="item-inner">
            <div class="item-title label">新密码<span class="xx">*</span></div>
            <div class="item-input">
              <input type="text" name="password" id="password" placeholder="请输入您的新密码" class="">
            </div>
          </div>
        </div>
      </li>
	  <li>
        <div class="item-content">
          <div class="item-media"><i class="icon icon-form-password"></i></div>
          <div class="item-inner">
            <div class="item-title label">身份证号<span class="xx">*</span></div>
            <div class="item-input">
              <input type="text" name="card" id="card" placeholder="请输入您的身份证号码" class="">
            </div>
          </div>
        </div>
      </li>
<!--       <li>
        <div class="item-content">
          <div class="item-media"><i class="icon icon-form-password"></i></div>
          <div class="item-inner">
            <div class="item-input">
				<input type="text" placeholder="请输入短信验证码" style="width:55%;float:left">
			</div>
            <div class="item-title label">
				<input type="button" value="获取短信验证码" onclick='sendSMS()' id="btn" style="display:block;height:3em;cursor:pointer;text-align:center;line-height:1em;margin-top:0.6em;width:100%;background:skyblue;border:1px solid skyblue;float:left;border-radius:5px;">
			  
			</div>
          </div>
        </div>
      </li> -->
      <li class="align-top">
        <div class="item-content">
          <div class="item-media"><i class="icon icon-form-comment"></i></div>
          <div class="item-inner">
            <div class="item-title label">激活说明:</div>
            <div class="item-input">
              <p>本功能只针对未激活的会员有效,已经激活的用户无需二次激活.激活成功后即可用自己的手机号码和新密码登陆<a href="http://www.zzumall.com">莫宁商城官网</a>正常体验购物等特权,同时原卡号和密码作废!</p>
            </div>
          </div>
        </div>
      </li>
    </ul>
	</form>
  </div>
  <div class="content-block">

      <div class="col-50"><a href="#" class="button button-big button-fill button-success btn-full">立即激活</a></div>
  </div>
    <script type='text/javascript' src='http://g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
    <script type='text/javascript' src='http://g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
	<script>
		var overTime=6;
		$(function(){
			 $(document).on('click','.button',function () {
				var account=$("#account").val();
				var pwd=$("#pwd").val();
				var password=$("#password").val();
				var mobile=$("#mobile").val();
				var name=$("#true_name").val();
				var card=$("#card").val();
				if(account==''){
					$.alert('卡号不能为空!','错误提示');
					return false;
				}
				if(pwd==''){
					$.alert('初始密码不能为空!','错误提示');
					return false;
				}
				if(name==''){
					$.alert('姓名不能为空!','错误提示');
					return false;
				}
				if(mobile==''){
					$.alert('手机号码不能为空!','错误提示');
					return false;
				}
				if(password==''){
					$.alert('新密码不能为空!','错误提示');
					return false;
				}
				
				if(card==''){
					$.alert('身份证号不能为空!','错误提示');
					return false;
				}
				 $.showPreloader('处理中...')
					setTimeout(function () {
						$.hidePreloader();
					}, 3000);
					$.post("{:U('Other/jihuo')}",{
					'account':account,
					'pwd':mobile,
					'password':pwd,
					'mobile':mobile,
					'name':name,
					'card':card,
					},function(data){
						if(data==11){
							$.alert("手机号码已经存在","错误提示");
						}else if(data==22){
							$.alert("账号或者密码错误,或者已经激活.","错误提示");
						}else if(data==33){
							$.alert("恭喜你,激活成功了!","成功提示");
						}else if(data==44){
							$.alert("该账号无需激活!","错误提示");
						}else{
							$.alert("网络故障!","错误提示");
						}
						
					 })
				
			 });
		});
		function sendSMS(){
		var mobile=$("#mobile").val();//17708054464
			console.debug(mobile);
			$.post("{:U('Other/send_code')}",{'mobile':mobile},function(data){
			console.debug(data);
				if(data==1){
					$.alert(mobile+'验证码已发送!');
				}else if(data==2){
					$.alert('请求错误!');
				}else{
					$.alert('网络故障!');
				}
			})
			
			$('#btn').attr('disabled',"true");//添加disabled属性
			$('#btn').css('background',"#ccc");
			obj=window.setInterval("setTime()",1000);//1000为1秒钟
		}
		function setTime(){
		console.debug(overTime)
			if(overTime>1){
				overTime--;
				$("#btn").val(overTime+'s后可重发');
				
			}else{
				$('#btn').removeAttr("disabled"); //移除disabled属性
				$('#btn').css('background',"skyblue");
				$("#btn").val('获取验证码');
				window.clearInterval(obj);
				overTime=5;
			}
			
			
		}
	</script>
  </body>
</html>